Integrand size = 23, antiderivative size = 173 \[ \int (c+d x)^2 \sec (a+b x) \sin (3 a+3 b x) \, dx=-\frac {2 c d x}{b}-\frac {d^2 x^2}{b}-\frac {i (c+d x)^3}{3 d}+\frac {(c+d x)^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {i d (c+d x) \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^2}+\frac {d^2 \operatorname {PolyLog}\left (3,-e^{2 i (a+b x)}\right )}{2 b^3}+\frac {2 d (c+d x) \cos (a+b x) \sin (a+b x)}{b^2}-\frac {d^2 \sin ^2(a+b x)}{b^3}+\frac {2 (c+d x)^2 \sin ^2(a+b x)}{b} \]
[Out]
Time = 0.38 (sec) , antiderivative size = 173, normalized size of antiderivative = 1.00, number of steps used = 14, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.391, Rules used = {4516, 4489, 3391, 4492, 3800, 2221, 2611, 2320, 6724} \[ \int (c+d x)^2 \sec (a+b x) \sin (3 a+3 b x) \, dx=\frac {d^2 \operatorname {PolyLog}\left (3,-e^{2 i (a+b x)}\right )}{2 b^3}-\frac {d^2 \sin ^2(a+b x)}{b^3}-\frac {i d (c+d x) \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^2}+\frac {2 d (c+d x) \sin (a+b x) \cos (a+b x)}{b^2}+\frac {(c+d x)^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}+\frac {2 (c+d x)^2 \sin ^2(a+b x)}{b}-\frac {2 c d x}{b}-\frac {d^2 x^2}{b}-\frac {i (c+d x)^3}{3 d} \]
[In]
[Out]
Rule 2221
Rule 2320
Rule 2611
Rule 3391
Rule 3800
Rule 4489
Rule 4492
Rule 4516
Rule 6724
Rubi steps \begin{align*} \text {integral}& = \int \left (3 (c+d x)^2 \cos (a+b x) \sin (a+b x)-(c+d x)^2 \sin ^2(a+b x) \tan (a+b x)\right ) \, dx \\ & = 3 \int (c+d x)^2 \cos (a+b x) \sin (a+b x) \, dx-\int (c+d x)^2 \sin ^2(a+b x) \tan (a+b x) \, dx \\ & = \frac {3 (c+d x)^2 \sin ^2(a+b x)}{2 b}-\frac {(3 d) \int (c+d x) \sin ^2(a+b x) \, dx}{b}+\int (c+d x)^2 \cos (a+b x) \sin (a+b x) \, dx-\int (c+d x)^2 \tan (a+b x) \, dx \\ & = -\frac {i (c+d x)^3}{3 d}+\frac {3 d (c+d x) \cos (a+b x) \sin (a+b x)}{2 b^2}-\frac {3 d^2 \sin ^2(a+b x)}{4 b^3}+\frac {2 (c+d x)^2 \sin ^2(a+b x)}{b}+2 i \int \frac {e^{2 i (a+b x)} (c+d x)^2}{1+e^{2 i (a+b x)}} \, dx-\frac {d \int (c+d x) \sin ^2(a+b x) \, dx}{b}-\frac {(3 d) \int (c+d x) \, dx}{2 b} \\ & = -\frac {3 c d x}{2 b}-\frac {3 d^2 x^2}{4 b}-\frac {i (c+d x)^3}{3 d}+\frac {(c+d x)^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}+\frac {2 d (c+d x) \cos (a+b x) \sin (a+b x)}{b^2}-\frac {d^2 \sin ^2(a+b x)}{b^3}+\frac {2 (c+d x)^2 \sin ^2(a+b x)}{b}-\frac {d \int (c+d x) \, dx}{2 b}-\frac {(2 d) \int (c+d x) \log \left (1+e^{2 i (a+b x)}\right ) \, dx}{b} \\ & = -\frac {2 c d x}{b}-\frac {d^2 x^2}{b}-\frac {i (c+d x)^3}{3 d}+\frac {(c+d x)^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {i d (c+d x) \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^2}+\frac {2 d (c+d x) \cos (a+b x) \sin (a+b x)}{b^2}-\frac {d^2 \sin ^2(a+b x)}{b^3}+\frac {2 (c+d x)^2 \sin ^2(a+b x)}{b}+\frac {\left (i d^2\right ) \int \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right ) \, dx}{b^2} \\ & = -\frac {2 c d x}{b}-\frac {d^2 x^2}{b}-\frac {i (c+d x)^3}{3 d}+\frac {(c+d x)^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {i d (c+d x) \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^2}+\frac {2 d (c+d x) \cos (a+b x) \sin (a+b x)}{b^2}-\frac {d^2 \sin ^2(a+b x)}{b^3}+\frac {2 (c+d x)^2 \sin ^2(a+b x)}{b}+\frac {d^2 \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,-x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{2 b^3} \\ & = -\frac {2 c d x}{b}-\frac {d^2 x^2}{b}-\frac {i (c+d x)^3}{3 d}+\frac {(c+d x)^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {i d (c+d x) \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^2}+\frac {d^2 \operatorname {PolyLog}\left (3,-e^{2 i (a+b x)}\right )}{2 b^3}+\frac {2 d (c+d x) \cos (a+b x) \sin (a+b x)}{b^2}-\frac {d^2 \sin ^2(a+b x)}{b^3}+\frac {2 (c+d x)^2 \sin ^2(a+b x)}{b} \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(516\) vs. \(2(173)=346\).
Time = 6.37 (sec) , antiderivative size = 516, normalized size of antiderivative = 2.98 \[ \int (c+d x)^2 \sec (a+b x) \sin (3 a+3 b x) \, dx=\frac {i d^2 e^{-i a} \left (2 b^2 x^2 \left (2 b x-3 i \left (1+e^{2 i a}\right ) \log \left (1+e^{-2 i (a+b x)}\right )\right )+6 b \left (1+e^{2 i a}\right ) x \operatorname {PolyLog}\left (2,-e^{-2 i (a+b x)}\right )-3 i \left (1+e^{2 i a}\right ) \operatorname {PolyLog}\left (3,-e^{-2 i (a+b x)}\right )\right ) \sec (a)}{12 b^3}+\frac {c^2 \sec (a) (\cos (a) \log (\cos (a) \cos (b x)-\sin (a) \sin (b x))+b x \sin (a))}{b \left (\cos ^2(a)+\sin ^2(a)\right )}+\frac {c d \csc (a) \left (b^2 e^{-i \arctan (\cot (a))} x^2-\frac {\cot (a) \left (i b x (-\pi -2 \arctan (\cot (a)))-\pi \log \left (1+e^{-2 i b x}\right )-2 (b x-\arctan (\cot (a))) \log \left (1-e^{2 i (b x-\arctan (\cot (a)))}\right )+\pi \log (\cos (b x))-2 \arctan (\cot (a)) \log (\sin (b x-\arctan (\cot (a))))+i \operatorname {PolyLog}\left (2,e^{2 i (b x-\arctan (\cot (a)))}\right )\right )}{\sqrt {1+\cot ^2(a)}}\right ) \sec (a)}{b^2 \sqrt {\csc ^2(a) \left (\cos ^2(a)+\sin ^2(a)\right )}}-\frac {\cos (2 b x) \left (2 b^2 c^2 \cos (2 a)-d^2 \cos (2 a)+4 b^2 c d x \cos (2 a)+2 b^2 d^2 x^2 \cos (2 a)-2 b c d \sin (2 a)-2 b d^2 x \sin (2 a)\right )}{2 b^3}+\frac {\left (2 b c d \cos (2 a)+2 b d^2 x \cos (2 a)+2 b^2 c^2 \sin (2 a)-d^2 \sin (2 a)+4 b^2 c d x \sin (2 a)+2 b^2 d^2 x^2 \sin (2 a)\right ) \sin (2 b x)}{2 b^3}-\frac {1}{3} x \left (3 c^2+3 c d x+d^2 x^2\right ) \tan (a) \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 385 vs. \(2 (161 ) = 322\).
Time = 1.39 (sec) , antiderivative size = 386, normalized size of antiderivative = 2.23
method | result | size |
risch | \(i c^{2} x -\frac {i d^{2} x^{3}}{3}-\frac {2 i d c \,a^{2}}{b^{2}}-\frac {4 i d c x a}{b}-\frac {\left (2 x^{2} d^{2} b^{2}+4 b^{2} c d x +2 i b \,d^{2} x +2 b^{2} c^{2}+2 i b c d -d^{2}\right ) {\mathrm e}^{2 i \left (x b +a \right )}}{4 b^{3}}-\frac {\left (2 x^{2} d^{2} b^{2}+4 b^{2} c d x -2 i b \,d^{2} x +2 b^{2} c^{2}-2 i b c d -d^{2}\right ) {\mathrm e}^{-2 i \left (x b +a \right )}}{4 b^{3}}-\frac {2 d^{2} a^{2} \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}+\frac {i c^{3}}{3 d}+\frac {2 c d \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right ) x}{b}-\frac {i d^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{2 i \left (x b +a \right )}\right ) x}{b^{2}}+\frac {4 c d a \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}-\frac {i c d \operatorname {polylog}\left (2, -{\mathrm e}^{2 i \left (x b +a \right )}\right )}{b^{2}}+\frac {2 i d^{2} a^{2} x}{b^{2}}-i d c \,x^{2}+\frac {4 i d^{2} a^{3}}{3 b^{3}}+\frac {d^{2} \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right ) x^{2}}{b}+\frac {d^{2} \operatorname {polylog}\left (3, -{\mathrm e}^{2 i \left (x b +a \right )}\right )}{2 b^{3}}+\frac {c^{2} \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right )}{b}-\frac {2 c^{2} \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b}\) | \(386\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 681 vs. \(2 (158) = 316\).
Time = 0.30 (sec) , antiderivative size = 681, normalized size of antiderivative = 3.94 \[ \int (c+d x)^2 \sec (a+b x) \sin (3 a+3 b x) \, dx=\frac {2 \, b^{2} d^{2} x^{2} + 4 \, b^{2} c d x - 2 \, {\left (2 \, b^{2} d^{2} x^{2} + 4 \, b^{2} c d x + 2 \, b^{2} c^{2} - d^{2}\right )} \cos \left (b x + a\right )^{2} + 2 \, d^{2} {\rm polylog}\left (3, i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) + 2 \, d^{2} {\rm polylog}\left (3, i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) + 2 \, d^{2} {\rm polylog}\left (3, -i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) + 2 \, d^{2} {\rm polylog}\left (3, -i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) + 4 \, {\left (b d^{2} x + b c d\right )} \cos \left (b x + a\right ) \sin \left (b x + a\right ) - 2 \, {\left (-i \, b d^{2} x - i \, b c d\right )} {\rm Li}_2\left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) - 2 \, {\left (i \, b d^{2} x + i \, b c d\right )} {\rm Li}_2\left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) - 2 \, {\left (i \, b d^{2} x + i \, b c d\right )} {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) - 2 \, {\left (-i \, b d^{2} x - i \, b c d\right )} {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right )}{2 \, b^{3}} \]
[In]
[Out]
\[ \int (c+d x)^2 \sec (a+b x) \sin (3 a+3 b x) \, dx=\int \left (c + d x\right )^{2} \sin {\left (3 a + 3 b x \right )} \sec {\left (a + b x \right )}\, dx \]
[In]
[Out]
none
Time = 0.32 (sec) , antiderivative size = 303, normalized size of antiderivative = 1.75 \[ \int (c+d x)^2 \sec (a+b x) \sin (3 a+3 b x) \, dx=-\frac {c^{2} {\left (2 \, \cos \left (2 \, b x + 2 \, a\right ) - \log \left (\cos \left (2 \, b x\right )^{2} + 2 \, \cos \left (2 \, b x\right ) \cos \left (2 \, a\right ) + \cos \left (2 \, a\right )^{2} + \sin \left (2 \, b x\right )^{2} - 2 \, \sin \left (2 \, b x\right ) \sin \left (2 \, a\right ) + \sin \left (2 \, a\right )^{2}\right )\right )}}{2 \, b} + \frac {-2 i \, b^{3} d^{2} x^{3} - 6 i \, b^{3} c d x^{2} + 3 \, d^{2} {\rm Li}_{3}(-e^{\left (2 i \, b x + 2 i \, a\right )}) - 6 \, {\left (-i \, b^{2} d^{2} x^{2} - 2 i \, b^{2} c d x\right )} \arctan \left (\sin \left (2 \, b x + 2 \, a\right ), \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) - 3 \, {\left (2 \, b^{2} d^{2} x^{2} + 4 \, b^{2} c d x - d^{2}\right )} \cos \left (2 \, b x + 2 \, a\right ) - 6 \, {\left (i \, b d^{2} x + i \, b c d\right )} {\rm Li}_2\left (-e^{\left (2 i \, b x + 2 i \, a\right )}\right ) + 3 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x\right )} \log \left (\cos \left (2 \, b x + 2 \, a\right )^{2} + \sin \left (2 \, b x + 2 \, a\right )^{2} + 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) + 6 \, {\left (b d^{2} x + b c d\right )} \sin \left (2 \, b x + 2 \, a\right )}{6 \, b^{3}} \]
[In]
[Out]
\[ \int (c+d x)^2 \sec (a+b x) \sin (3 a+3 b x) \, dx=\int { {\left (d x + c\right )}^{2} \sec \left (b x + a\right ) \sin \left (3 \, b x + 3 \, a\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int (c+d x)^2 \sec (a+b x) \sin (3 a+3 b x) \, dx=\int \frac {\sin \left (3\,a+3\,b\,x\right )\,{\left (c+d\,x\right )}^2}{\cos \left (a+b\,x\right )} \,d x \]
[In]
[Out]